<template>
  <el-dialog :visible.sync="visible" v-dialogDrag :title="title" :close-on-click-modal="false" class="tl-dialog" width="1200px" @open="open" @close="close" :modal-append-to-body="false" :append-to-body="true">
    <el-form class="tl-form" ref="form" :model="model" :rules="rules" label-width="150px" :disabled="disableEditSubmit">
			<el-row>
<!--				<el-col :span="12">-->
<!--					<el-form-item label="任命书id" prop="appointmentid" >-->
<!--						<el-input-number v-model="model.appointmentid" controls-position="right" :step="1" :min="0" style="width:100%"></el-input-number>-->
<!--					</el-form-item>-->
<!--				</el-col>-->
<!--				<el-col :span="12">-->
<!--					<el-form-item label="项目编号" prop="projectcode" >-->
<!--						<el-input v-model="model.projectcode"></el-input>-->
<!--					</el-form-item>-->
<!--				</el-col>-->
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="工作组名称" prop="teamname"  :rules="rules.validateRequire" required>
						<el-input v-model="model.teamname"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
<!--			<el-row>-->
<!--				<el-col :span="24">-->
<!--					<el-form-item label="备注" prop="description" >-->
<!--						<el-input v-model="model.description" type="textarea" :rows="2"></el-input>-->
<!--					</el-form-item>-->
<!--				</el-col>-->
<!--			</el-row>-->
			<el-row>
				<el-col :span="12">
					<el-form-item label="排序码" prop="sortcode">
						<el-input-number v-model="model.sortcode" controls-position="right" :step="1" :min="1" style="width:100%"></el-input-number>
					</el-form-item>
				</el-col>
<!--				<el-col :span="12">-->
<!--					<el-form-item label="有效" prop="enabled">-->
<!--						<el-radio-group v-model="model.enabled">-->
<!--							<el-radio :label="parseInt(item.code)" v-for="item in codeModel.enabledList" :key="item.code">{{ item.name }}</el-radio>-->
<!--						</el-radio-group>-->
<!--					</el-form-item>-->
<!--				</el-col>-->
			</el-row>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button :type="disableEditSubmit === false ? 'text' : 'primary'" @click="doCancelEdit">取消</el-button>
      <el-button type="primary" @click="doSubmitEdit" :loading="saveLoading" v-if="disableEditSubmit === false">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
/** mixins */
import { mixin_edit } from '@tapui/mixins/mixin_edit'
/** 子组件 */
/** 工具类 */
import { putAction, getAction, postAction, deleteAction } from '@tapui/utils/http'
/** VUE配置 */
export default {
  mixins: [mixin_edit],
  components: { },
  data() {
    return {
      moduleTitle: '工作组分类',
      urlPrefix: '/sd/projectTeamType/',
      url: {
        // 额外的url
      }
    }
  },
  props: {
    projectCode: {
      type: String,
      default: ''
    },
    parentId: {
      type: Number,
      default: 0
    },
    projectId: {
      type: [String, Number],
      default: ''
    }
  },
  methods: {
    loaded() {
      // 页面加载完毕执行
    },
    afterSubmit() {
      if (this.model && this.model.id && this.model.id > 0) {
        this.$emit('refreshTable', this.model)
        this.$emit('insertArr', this.model)
      }
    },
    beforeSubmit() {
      this.model.appointmentid = this.parentId
      this.model.projectcode = this.projectCode
      this.model.projectid = this.projectId
      return true
    }
  }
}
</script>

